﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Windows;
using AvalonDock;
using PefStudio.StartUp;
using PefStudio.Windows;

namespace PefStudio.Windows
{
    public class AbstractPad : DockableContent, IPad
    {
        [Import(Bootstrapper.MainWindowContract, typeof(Window))]
        private Lazy<MainWindow> mainWindow { get; set; }
        protected MainWindow MainWindow
        {
            get { return mainWindow.Value; }
        }

        public new string Title
        {
            get
            {
                return base.Title;
            }
            set
            {
                if (base.Title == value)
                    return;

                base.Title = value;
                OnTitleChanged(EventArgs.Empty);
            }
        }

        public event EventHandler TitleChanged;
        void OnTitleChanged(EventArgs e)
        {
            if (TitleChanged != null)
            {
                TitleChanged(this, e);
            }
        }

        public string Text { get; set; }

        public string Description
        {
            get { return string.Empty; }
        }
    }
}
